$(function() {
    console.log(localStorage.getItem('token'));

    $(document).on("click", ".list-mycomment", function() {
        $('.mycomment').show();
        $('.list-me-mymessage, .myhaven, .myorder, .mycomment, .mysafe, .time').hide();

        $.ajax({
            url: "http://localhost:8080/usergetUserAssessByUserId/",
            type: "get",
            headers: {
                'token': sessionStorage.getItem('token')
            },
            dataType: "json",
            success: function(data) {
                data = data.t; // 确保返回的数据结构是正确的
                console.log(data);

                // 遍历评价数据并创建HTML元素
                data.forEach(function(item) {
                   
                    $(".order-photo").val(item.accessImage);   
                    $(".hotelInfo").val(item.accessInfo);      
                    $(".gotoTime").val(item.accessDate);       
                });
            },
            error: function(xhr, status, error) {
                // 请求失败时的处理
                alert("获取评价信息失败: " + "暂无评价信息");
            }
        });
    });
});
